<template>
  <div class="commentHead">
    <h1>车主评论</h1>
    <div class="commentMain">
      <div class="commentLeft">
        <h2>{{commentData.SERVICE_SCORE}}</h2>
        <p>总体点评</p>
      </div>
      <div class="commentRight">
        <div class="commentStar">
          <label>服务态度</label><span v-for='i in 5' :class='{spanActive:commentData.SERVICE_SCORE>(i-1)}'></span>
        </div>
        <div class="commentStar">
          <label>维修效率</label><span v-for='i in 5' :class='{spanActive:commentData.SPEED_SCORE>(i-1)}'></span>
        </div>
      </div>
    </div>
    <div class="commentClass">
      <div class="classItem classItem1" :class='{classItemActive:categoty==="all"}' @click='selectType("all")'>
        全部({{commentData.EVAL_ALL}})
      </div>
      <div class="classItem classItem1" :class='{classItemActive:categoty==="satisfy"}' @click='selectType("satisfy")'>
        满意({{commentData.EVAL_SATISFY}})
      </div>
      <div class="classItem classItem2" :class='{classItemActive1:categoty==="unsatisfy"}' @click='selectType("unsatisfy")'>
        不满意({{commentData.EVAL_UNSATISFY}})
      </div>
      <div class="classItem classItem2" :class='{classItemActive1:categoty==="photo"}' @click='selectType("photo")'>
        有图({{commentData.EVAL_PHOTO}})
      </div>
    </div>
  </div>
</template>
<script>
// 评论的头部
export default {
  name:"commentHead",
  // 数据
  data(){

    return{
    }
  },
  props:['commentData','categoty'],
  // 计算属性
  computed:{

  },
  // 创建（实例创建完成）
  created(){

  },
  // el被创建，并挂载到实例上
  mounted(){

  },
  // 方法（实例中的方法）-----------
  methods:{
    selectType(types){
      this.$emit('update:select-type',types);
    }
  },
  // 子组件
  components:{

  }
}
</script>
<!--当前页面的样式 -->
<style lang="less" scoped>
@import url('../assets/css/public.less');
.commentHead{
  width: 7.5rem;
  padding: 0.2rem 0.28rem;
  background: #fff;
  .commentClass{
    display: flex;
    justify-content:space-around;
    .classItem{
      width: 1.57rem;
      height: 0.56rem;
      font-size: 0.22rem;
      line-height: 0.56rem;
      border-radius: 0.08rem;
    }
    .classItem1{
      color: #232325;
      background: #fdd9d9;
    }
    .classItemActive{
      color: #fff;
      background: #F14043;
    }
    .classItem2{
      color: #232325;
      background: #F0F2F5;
    }
  }
  .commentMain{
    display: flex;
    margin: 0.2rem 0;
    height: 1.4rem;
    align-items: center;
    .borderTFu(#E2E2E2);
    padding: 0.2rem 0;
    .commentLeft{
      width: 2rem;
      height: 1rem;
      .borderRFu(#E2E2E2);
      h2{
        font-size: 0.43rem;
        color:#FC0D1B;
        font-weight: bold;
        margin:0.1rem 0;
      }
      p{
        font-size: 0.2rem;
        color: #ADADAD 100%;
      }
    }
    .commentRight{
      height: 1rem;
      padding-left: 0.2rem;
      .commentStar{
        height: 0.45rem;
        line-height: 0rem;

      }
      .commentStar:first-child{
        margin-bottom:0.1rem;
        margin-top: -0.05rem;
      }
      label{
        font-size: 0.28rem;
        color: #666666;
        padding-right: 0.15rem;
      }
      span{
        display: inline-block;
        width:0.26rem;
        height: 0.24rem;
        background: url(../assets/image/cafe/grayStar.png) no-repeat;
        background-size: 0.26rem 0.24rem;
      }
      .spanActive{
        background: url(../assets/image/cafe/star.png) no-repeat;
        background-size: 0.26rem 0.24rem;
      }
    }
  }
  h1{
    font-size: 0.28rem;
    color: #171717;
    text-align: left;
    padding: 0.02rem 0.1rem 0;
    border-left: 0.06rem solid #FC0D1B;
    margin-bottom: 0.2rem;
  }
}
</style>
